package com.fubowen.lepton.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.MapInfo
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import androidx.room.Upsert
import com.fubowen.lepton.bean.Home

@Dao
interface HomeDao {
    @Query("select * from Home")
    fun all(): List<Home>

    @Query("select * from Home where Id = :id")
    fun get(id: Int): Home?

    @Insert
    fun set(bean: Home)
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    fun setOrIgnore(bean: Home): Long

    @Update
    fun put(bean: Home)
    @Upsert
    fun setOrPut(bean: Home)

    @Delete
    fun del(bean: Home)

    @Query("DELETE FROM Home")
    fun clear()
}